package com.ssy.lingxi.contract.service;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.contract.model.bo.sign.SignFlowBO;
import com.ssy.lingxi.contract.model.vo.sign.request.AutoSignRequest;
import com.ssy.lingxi.contract.model.vo.sign.request.ContractSignatureRequest;
import com.ssy.lingxi.contract.model.vo.sign.request.OrderSettleSignDetailRequest;
import com.ssy.lingxi.contract.model.vo.sign.response.ContractSignatureUrlResponse;
import com.ssy.lingxi.contract.model.vo.sign.response.ContractUploadResponse;
import com.ssy.lingxi.contract.model.vo.sign.response.SignContractCreateResponse;
import com.ssy.lingxi.contract.model.vo.sign.response.SignatorySignDetailResponse;
import org.springframework.web.multipart.MultipartFile;

/**
 * 合同签署服务类
 * @author yzc
 * @version 2.0.0
 * @date 2021/1/28
 */
public interface IContractSignatureService {

    /**
     * 生成电子合同
     * @param request 请求参数
     * @param loginUser 登录用户信息
     * @return 返回结果
     */
    Wrapper<SignContractCreateResponse> contractCreate(ContractSignatureRequest request, UserLoginCacheDTO loginUser);

    /**
     * 合同文件上传
     * @param file 文件
     * @param loginUser 登录用户信息
     * @return 返回结果
     */
    Wrapper<ContractUploadResponse> contractUpload(MultipartFile file, UserLoginCacheDTO loginUser);

    /**
     * 创建签署合同流程
     * @param firstMemberId 甲方会员id
     * @param secondMemberId 乙方会员id
     * @param contractName 合同文件名称 如: 合同.doc
     * @param contractUrl 合同文件地址
     * @return 返回结果
     */
    SignFlowBO signatureFlowCreate(Long firstMemberId, Long secondMemberId, String contractName, String contractUrl);

    /**
     * 获取签署地址
     * @param request 请求参数
     * @param loginUser 登录用户信息
     * @return 返回结果
     */
    Wrapper<ContractSignatureUrlResponse> getHandSignatureUrl(AutoSignRequest request, UserLoginCacheDTO loginUser);

    /**
     * 查询签署人签署状态
     * @param request 请求参数
     * @param loginUser 登录用户信息
     * @return 返回结果
     */
    Wrapper<SignatorySignDetailResponse> getSignatorySignStatus(OrderSettleSignDetailRequest request, UserLoginCacheDTO loginUser);
}
